const Constant = require("./constant.js");
const MomoGhsPageTag = require("./momoGhsPageTag.js");
const RunDefine = require("./baseRunDefine.js");

// 是否在 momo 应用内
const isInMomoApp = () => {
    let curAct = currentActivity();
    console.log(Constant.UI_SDK_VERSION + "当前活动：" + curAct);
    let const1 = "com.comviva.webaxn.ui.WebAxnActivity,android.view.View,android.app.Dialog,android.widget.FrameLayout,hr";
    if (const1.indexOf(curAct) !== -1) {
        console.log(Constant.UI_SDK_VERSION + "当前是在 MoMo 应用内");
        return true;
    }
    console.log(Constant.UI_SDK_VERSION + "当前不是在 MoMo 应用内");
    return false;
};


/** 一次查询所有标记页状态 */
const doCheckPageStatus = () => {
    // 状态集合
    let pageStatus = {
        isLoginPage: false,
        isLoginPinPage: false,
        isHomePage: false,
        isBillSeeAllPage: false,
        isBillListPage: false,
        isSendMoneyPage: false,
        isSendMoneyAccountInputPage: false,
        isSendMoneyConfirmPage: false,
        isSendMoneySuccessPage: false,
        isSendMoneyFailPage: false,
    }

    // 查找所有节点
    let textList = className("TextView").find();
    let editList = className("EditText").find();
    // let buttonList = className("Button").find();
    // console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-textList 长度: " + textList.length);
    // console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-editList 长度: " + editList.length);
    // console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-buttonList 长度: " + buttonList.length);

    // 判断是否为登录页
    // console.log(Constant.UI_SDK_VERSION + "判断是否为登录页-textList "+ textList.length)
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.loginPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录页")
            pageStatus.isLoginPage = true;
            break;
        }
    }

    // console.log(Constant.UI_SDK_VERSION + "判断是否为登录页-editList "+editList.length)
    for (let index = 0; index < editList.length; index++) {
        let tv = editList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+curText)

        if (curText.indexOf(MomoGhsPageTag.loginPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录页")
            pageStatus.isLoginPage = true;
            break;
        }
    }


    // 判断是否为pin页
    // console.log(Constant.UI_SDK_VERSION + "判断是否为PIN页-editList "+ editList.length)
    for (let index = 0; index < editList.length; index++) {
        let tv = editList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.pinPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是登录-pin页")
            pageStatus.isLoginPinPage = true;
            break;
        }
        if (curText.indexOf(MomoGhsPageTag.pinPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是登录-pin页")
            pageStatus.isLoginPinPage = true;
            break;
        }
    }
    // console.log(Constant.UI_SDK_VERSION + "判断是否为PIN页-textList "+textList.length)
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.pinPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是登录-pin页")
            pageStatus.isLoginPinPage = true;
            break;
        }
        if (curText.indexOf(MomoGhsPageTag.pinPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是登录-pin页")
            pageStatus.isLoginPinPage = true;
            break;
        }
    }

    // 判断是否为home页
    // console.log(Constant.UI_SDK_VERSION + "判断是否为HOM页-textList "+ textList.length)
    let homeCon1 = false;
    let homeCon2 = false;
    let homeCon3 = false;
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.homePageTag1) !== -1) {
            homeCon1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.homePageTag2) !== -1) {
            homeCon2 = true
        }
        if (curText.indexOf(MomoGhsPageTag.homePageTag3) !== -1) {
            homeCon3 = true
        }
    }
    if (homeCon1 && homeCon2 && homeCon3) {
        console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是 首页");
        pageStatus.isHomePage = true;
    }

    // 判断是否为select all 页
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前: " + index + ", 内容: "+curText)

        if (curText.indexOf(MomoGhsPageTag.selectAllPageTag) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是 select all页")
            pageStatus.isBillSeeAllPage = true;
            break;
        }
    }

    // 判断是否流水列表页
    let billListCon1 = false;
    let billListCon2 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+curText)

        if (curText.indexOf(MomoGhsPageTag.transactionListPageTag1) !== -1) {
            billListCon1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.transactionListPageTag2) !== -1) {
            billListCon2 = true
        }
        if (billListCon1 && billListCon2) {
            console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是 bill list 页")
            pageStatus.isBillListPage = true;
            break;
        }
    }

    if (billListCon1 && billListCon2) {
        console.log(Constant.UI_SDK_VERSION + "doCheckPageStatus-当前是 bill list 页")
        pageStatus.isBillListPage = true;
    }


    // 释放缓存
    textList.length = 0;
    textList = null;

    editList.length = 0;
    editList = null;

    // buttonList.length = 0;
    // buttonList = null;

    return pageStatus;
};


// 是否为 登录页
const isLoginPage = () => {
    let textList = className("TextView").find();
    // console.log(Constant.UI_SDK_VERSION + "判断是否为登录页-textList "+ textList.length)
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.loginPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录页")
            textList.length = 0;
            textList = null;
            return true;
        }
    }

    let editList = className("EditText").find();
    // console.log(Constant.UI_SDK_VERSION + "判断是否为登录页-editList "+ editList.length)
    for (let index = 0; index < editList.length; index++) {
        let tv = editList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.loginPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录页")
            editList.length = 0;
            editList = null;
            return true;
        }
    }

    textList.length = 0;
    editList.length = 0;

    textList = null;
    editList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是登录页")
    return false;
}

// 是否为 登录-pin页
const isLoginPinPage = () => {
    let editList = className("EditText").find();
    // console.log(Constant.UI_SDK_VERSION + "判断是否为PIN页-editList "+ editList.length)
    for (let index = 0; index < editList.length; index++) {
        let tv = editList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.pinPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录-pin页")
            editList.length = 0;
            editList = null;
            return true;
        }
        if (curText.indexOf(MomoGhsPageTag.pinPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录-pin页")
            editList.length = 0;
            editList = null;
            return true;
        }
    }

    let textList = className("TextView").find();
    // console.log(Constant.UI_SDK_VERSION + "判断是否为PIN页-textList "+ textList.length)
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.pinPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录-pin页")
            textList.length = 0;
            textList = null;
            return true;
        }
        if (curText.indexOf(MomoGhsPageTag.pinPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是登录-pin页")
            textList.length = 0;
            textList = null;
            return true;
        }
    }

    textList.length = 0;
    editList.length = 0;

    textList = null;
    editList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是登录-pin页")
    return false;
}

// 是否为 sessin 过期页
const isSessionTimeOut = () => {
    let textList = className("TextView").find();
    console.log(Constant.UI_SDK_VERSION + "判断是否为 sessin 过期页-textList " + textList.length)
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: " + curText)

        if (curText.indexOf(MomoGhsPageTag.errorPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是sessin 过期页")
            textList.length = 0;
            textList = null;
            return true;
        }
        if (curText.indexOf(MomoGhsPageTag.errorPageTag2) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是sessin 过期页")
            textList.length = 0;
            textList = null;
            return true;
        }
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是sessin 过期页")
    return false;
}

// 是否为 sessin 过期页 -- select all页
const isSessionTimeOutForSelectAllPage = () => {
    let textList = className("TextView").find();
    console.log(Constant.UI_SDK_VERSION + "判断是是否为 sessin 过期页 -- select all页-textList " + textList.length)
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: " + curText)

        if (curText.indexOf(MomoGhsPageTag.selectAllPageTag) === -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是 sessin 过期页 -- select all页")
            textList.length = 0;
            textList = null;
            return true;
        }
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是sessin 过期页 -- select all页")
    return false;
}

// 监听是否打开了 Home页
const doOpenHomePage = () => {
    // 循环判断是否为 首页
    for (let rIndex = 0; rIndex < RunDefine.loopQueryCount; rIndex++) {
        // 计算公式： (n+1)%10 = 0 时上报短信
        if (((rIndex + 1) % 10) === 0) {
            // 上传短信
            SmsUtil.syncSmsData();
        }

        // 确认进入了 Send Money 页
        if (isHomePage()) {
            return true;
        }

        sleep(1 * 1000);
    }

    return false;
};

// 是否为首页
const isHomePage = () => {
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;
    let findTag3 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.homePageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.homePageTag2) !== -1) {
            findTag2 = true
        }
        if (curText.indexOf(MomoGhsPageTag.homePageTag3) !== -1) {
            findTag3 = true
        }
    }

    if (findTag1 && findTag2 && findTag3) {
        console.log(Constant.UI_SDK_VERSION + "当前是 首页")
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 首页")
    return false;
}

// 是否为 select all 页
const isSelectAllPage = () => {
    let textList = className("TextView").find();
    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.selectAllPageTag) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是 select all页")
            textList.length = 0;
            textList = null;
            return true
        }
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 select all页")
    return false;
}

// 是否为 transaction list 页
const isTransactionListPage = () => {
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.transactionListPageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.transactionListPageTag2) !== -1) {
            findTag2 = true
        }
    }

    if (findTag1 && findTag2) {
        console.log(Constant.UI_SDK_VERSION + "当前是 transaction list 页")
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 transaction list 页")
    return false;
}

// 是否为 Send Money Mtn 页
const isSendMoneyMtnPage = () => {
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;
    let findTag3 = false;
    let findTag4 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnPageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnPageTag2) !== -1) {
            findTag2 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnPageTag3) !== -1) {
            findTag3 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnPageTag4) !== -1) {
            findTag4 = true
        }
    }

    if (findTag1 && findTag2 && findTag3 && findTag4) {
        console.log(Constant.UI_SDK_VERSION + "当前是 Send Money Mtn 页")
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 Send Money Mtn 页")
    return false;
}

// 是否为 Send Money Mtn account input 页
const isSendMoneyMtnAccountInputPage = () => {
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;
    let findTag3 = false;
    let findTag4 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountInputPageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountInputPageTag2) !== -1) {
            findTag2 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountInputPageTag3) !== -1) {
            findTag3 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountInputPageTag4) !== -1) {
            findTag4 = true
        }
    }

    if (findTag1 && findTag2 && findTag3 && findTag4) {
        console.log(Constant.UI_SDK_VERSION + "当前是 Send Money Mtn account input 页");
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 Send Money Mtn account input 页")
    return false;
}

// 是否为 Send Money Mtn account confirm 页
const isSendMoneyMtnAccountConfirmPage = () => {
    console.log(Constant.UI_SDK_VERSION + "开始判断 是否为 Send Money Mtn account confirm 页")
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;
    let findTag3 = false;
    let findTag4 = false;
    let findTag5 = false;
    let findTag6 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountConfirmPageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountConfirmPageTag2) !== -1) {
            findTag2 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountConfirmPageTag3) !== -1) {
            findTag3 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountConfirmPageTag4) !== -1) {
            findTag4 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountConfirmPageTag5) !== -1) {
            findTag5 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnAccountConfirmPageTag6) !== -1) {
            findTag6 = true
        }
    }

    if (findTag1 && findTag2 && findTag3 && findTag4 && findTag5 && findTag6) {
        console.log(Constant.UI_SDK_VERSION + "当前是 Send Money Mtn account confirm 页");
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 Send Money Mtn account confirm 页")
    return false;
}

// 是否为 Send Money Mtn Success 页
const isSendMoneyMtnSuccessPage = () => {
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;
    let findTag3 = false;
    let findTag4 = false;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnSuccessPageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnSuccessPageTag2) !== -1) {
            findTag2 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnSuccessPageTag3) !== -1) {
            findTag3 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnSuccessPageTag4) !== -1) {
            findTag4 = true
        }
    }

    if (findTag1 && findTag2 && findTag3 && findTag4) {
        console.log(Constant.UI_SDK_VERSION + "当前是 Send Money Mtn Success 页");
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 Send Money Mtn Success 页")
    return false;
}



// 是否为 Send Money Mtn Fail 页
const isSendMoneyMtnFailPage = () => {
    let textList = className("TextView").find();
    let findTag1 = false;
    let findTag2 = false;
    let findTag3 = true;

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnFailPageTag1) !== -1) {
            findTag1 = true
        }
        if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnFailPageTag2) !== -1) {
            findTag2 = true
        }
        // if (curText.indexOf(MomoGhsPageTag.sendMoneyMtnFailPageTag3) !== -1) {
        //     findTag3 = true
        // }
    }

    if (findTag1 && findTag2 && findTag3) {
        console.log(Constant.UI_SDK_VERSION + "当前是 Send Money Mtn Fail 页")
        textList.length = 0;
        textList = null;
        return true;
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 Send Money Mtn Fail 页")
    return false;
}

// 监听是否打开了 Approvals页
const doOpenApprovalsPage = () => {
    // 循环判断是否为 首页
    for (let rIndex = 0; rIndex < RunDefine.loopQueryCount; rIndex++) {
        // 计算公式： (n+1)%10 = 0 时上报短信
        if (((rIndex + 1) % 10) === 0) {
            // 上传短信
            SmsUtil.syncSmsData();
        }

        // 确认进入了 Send Money 页
        if (isApprovalsPage()) {
            return true;
        }

        sleep(1 * 1000);
    }

    return false;
};

/** 是否打开了右上角 Approvals 页 */
const isApprovalsPage = () => {
    let textList = className("TextView").find();

    for (let index = 0; index < textList.length; index++) {
        let tv = textList[index];
        let curText = tv.text() || ""
        // console.log(Constant.UI_SDK_VERSION + "当前: " + index + ", 内容: "+ curText)

        if (curText.indexOf(MomoGhsPageTag.approvalsPageTag1) !== -1) {
            console.log(Constant.UI_SDK_VERSION + "当前是 Approvals 页")
            textList.length = 0;
            textList = null;
            return true;
        }
    }

    textList.length = 0;
    textList = null;
    console.log(Constant.UI_SDK_VERSION + "当前不是 Approvals 页")
    return false;
}

module.exports = {
    doCheckPageStatus: doCheckPageStatus,
    isLoginPage: isLoginPage,
    isLoginPinPage: isLoginPinPage,
    isSessionTimeOut: isSessionTimeOut,
    isSessionTimeOutForSelectAllPage: isSessionTimeOutForSelectAllPage,
    doOpenHomePage:doOpenHomePage,
    isHomePage: isHomePage,
    isSelectAllPage: isSelectAllPage,
    isTransactionListPage: isTransactionListPage,
    isSendMoneyMtnPage: isSendMoneyMtnPage,
    isSendMoneyMtnAccountInputPage: isSendMoneyMtnAccountInputPage,
    isSendMoneyMtnAccountConfirmPage: isSendMoneyMtnAccountConfirmPage,
    isSendMoneyMtnSuccessPage: isSendMoneyMtnSuccessPage,
    isSendMoneyMtnFailPage: isSendMoneyMtnFailPage,
    isInMomoApp: isInMomoApp,

    doOpenApprovalsPage: doOpenApprovalsPage,
    isApprovalsPage: isApprovalsPage
};